Are some PS enriched?

Using myTAI::pStrata -> ggplot2::geom_col or ggplot2::geom_area doesn’t lead to interesting results. The way to do it is probably with a heatmap. myTAI::pTAI also doesn’t look so nice.

library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.2     ✔ readr     2.1.4
## ✔ forcats   1.0.0     ✔ stringr   1.5.0
## ✔ ggplot2   3.4.2     ✔ tibble    3.2.1
## ✔ lubridate 1.9.2     ✔ tidyr     1.3.0
## ✔ purrr     1.0.2     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(myTAI)
#  myTAI v1.0.1.9000 2023-07-12 Github (drostlab/myTAI@46eb927)

Playing around with PhyloExpressionSetExample

Based on this, I can intuit which type of analysis may be appropriate.

data(PhyloExpressionSetExample)

heatmap(myTAI::pStrata(PhyloExpressionSetExample))

pStrata_data <-
  tibble::as_tibble(myTAI::pStrata(PhyloExpressionSetExample), rownames = "PS") %>%
  tidyr::pivot_longer(!PS, names_to = "Stage", values_to = "pStrata")

pStrata_data$Stage <-
  pStrata_data$Stage <- base::factor(pStrata_data$Stage, unique(pStrata_data$Stage))

pStrata_data %>%
  ggplot2::ggplot(aes(x = Stage, y = PS, fill = pStrata)) +
  ggplot2::geom_tile()

# 
# pStrata_data %>% 
#   ggplot2::ggplot(aes(x = Stage, y = pStrata, fill = PS)) +
#   ggplot2::geom_col()
# 
# pStrata_data2 <-
#   pStrata_data %>%
#   dplyr::mutate(
#     Stage_number = dplyr::case_when(
#       Stage == "Zygote" ~ 1,
#       Stage == "Quadrant" ~ 2,
#       Stage == "Globular" ~ 3,
#       Stage == "Heart" ~ 4,
#       Stage == "Torpedo" ~ 5,
#       Stage == "Bent" ~ 6,
#       Stage == "Mature" ~ 7
#     )
#   ) %>%
#   dplyr::group_by(Stage) %>%
#   dplyr::mutate(
#     prop = pStrata/sum(pStrata)
#   )
# 
# pStrata_data2 %>% 
#   ggplot2::ggplot(aes(x = Stage_number, y = prop, fill = PS)) +
#   ggplot2::geom_area(alpha=0.6 , size=1, colour="black")
# # Works but uninteresting.
# pTAI_data <-
#   tibble::as_tibble(myTAI::pTAI(PhyloExpressionSetExample), rownames = "PS") %>%
#   tidyr::pivot_longer(!PS, names_to = "Stage", values_to = "pTAI_accumulated")
# 
# pTAI_data$Stage <-
#   pTAI_data$Stage <- base::factor(pTAI_data$Stage, unique(pTAI_data$Stage))
# 
# pTAI_data %>%
#   ggplot2::ggplot(aes(x = Stage, y = pTAI_accumulated, group = PS, colour = PS)) +
#   ggplot2::geom_line()
PlotCategoryExpr(ExpressionSet = myTAI::tf(PhyloExpressionSetExample, FUN = log2, pseudocount = 1),
                     legendName    = "PS",
                     test.stat     = TRUE,
                     type          = "category-centered",
                     distr.type    = "boxplot",
                     log.expr      = FALSE)
##                   Zygote Quadrant Globular Heart Torpedo Bent  Mature
## category-centered "***"  "***"    "***"    "***" "***"   "***" "***"

PlotCategoryExpr(ExpressionSet = myTAI::tf(PhyloExpressionSetExample, FUN = log2, pseudocount = 1),
                     legendName    = "PS",
                     test.stat     = TRUE,
                     type          = "stage-centered",
                     distr.type    = "boxplot",
                     log.expr      = FALSE)
##                PS1   PS2   PS3    PS4 PS5    PS6 PS7    PS8    PS9    PS10 
## stage-centered "***" "***" "n.s." "*" "n.s." "*" "n.s." "n.s." "n.s." "***"
##                PS11   PS12 
## stage-centered "n.s." "***"

Fucus analysis

Here, I focus on the stages that generates the Fucus embryo, i.e. stages not gamates nor matSP.

Fd_PES <-
  readr::read_csv(file = "data/Fd_PES.csv") %>%
  dplyr::select(!c("gamete","matSP"))
## Rows: 7898 Columns: 9
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (1): GeneID
## dbl (8): Phylostratum, gamete, E1, E2, E3, E4, E5, matSP
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
Fs_PES <-
  readr::read_csv(file = "data/Fs_PES.csv") %>%
  dplyr::select(!c("gamete","matSP"))
## Rows: 8291 Columns: 9
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (1): GeneID
## dbl (8): Phylostratum, gamete, 24H, 48H, 1w, 3w, 4w, matSP
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.

sqrt-tranformed

Fd_PES.sqrt <-
  readr::read_csv(file = "data/Fd_PES.sqrt.csv") %>%
  dplyr::select(!c("gamete","matSP"))
## Rows: 7898 Columns: 9
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (1): GeneID
## dbl (8): Phylostratum, gamete, E1, E2, E3, E4, E5, matSP
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
Fs_PES.sqrt <-
  readr::read_csv(file = "data/Fs_PES.sqrt.csv") %>%
  dplyr::select(!c("gamete","matSP"))
## Rows: 8291 Columns: 9
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (1): GeneID
## dbl (8): Phylostratum, gamete, 24H, 48H, 1w, 3w, 4w, matSP
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.

log2-tranformed

Fd_PES.log2 <-
  readr::read_csv(file = "data/Fd_PES.log2.csv") %>%
  dplyr::select(!c("gamete","matSP"))
## Rows: 7898 Columns: 9
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (1): GeneID
## dbl (8): Phylostratum, gamete, E1, E2, E3, E4, E5, matSP
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
Fs_PES.log2 <-
  readr::read_csv(file = "data/Fs_PES.log2.csv") %>%
  dplyr::select(!c("gamete","matSP"))
## Rows: 8291 Columns: 9
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (1): GeneID
## dbl (8): Phylostratum, gamete, 24H, 48H, 1w, 3w, 4w, matSP
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
# different sexes
Fd_PES_sex.log2 <-
  readr::read_csv(file = "data/Fd_PES_M.log2.csv") %>%
  dplyr::rename(gamete_M = V1)
## Rows: 7898 Columns: 3
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (1): GeneID
## dbl (2): Phylostratum, V1
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
Fd_PES_sex.log2 <-
  readr::read_csv(file = "data/Fd_PES_F.log2.csv") %>%
  dplyr::rename(gamete_F = V1) %>%
  left_join(Fd_PES_sex.log2)
## Rows: 7898 Columns: 3
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (1): GeneID
## dbl (2): Phylostratum, V1
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
## Joining with `by = join_by(Phylostratum, GeneID)`
Fs_PES_sex.log2 <-
  readr::read_csv(file = "data/Fs_PES_M.log2.csv") %>% 
  dplyr::rename_with(
    ~ paste0(.x, "_M"),
    dplyr::starts_with(c("gamete", "mat")) &! dplyr::ends_with("_F"))
## Rows: 8291 Columns: 4
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (1): GeneID
## dbl (3): Phylostratum, gamete, matSP
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
Fs_PES_sex.log2 <-
  readr::read_csv(file = "data/Fs_PES_F.log2.csv") %>% 
  dplyr::rename_with(
    ~ paste0(.x, "_F"),
    dplyr::starts_with(c("gamete", "mat")) &! dplyr::ends_with("_M")) %>%
  dplyr::left_join(Fs_PES_sex.log2)
## Rows: 8291 Columns: 4
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (1): GeneID
## dbl (3): Phylostratum, gamete, matSP
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
## Joining with `by = join_by(Phylostratum, GeneID)`
Fs_PES_sex_mat.log2 <- 
  Fs_PES_sex.log2 %>%
  dplyr::select(!dplyr::starts_with("gamete"))
Fs_PES_sex_gam.log2 <- 
  Fs_PES_sex.log2 %>%
  dplyr::select(!dplyr::starts_with("mat"))

# different tissues
Fd_PES_matSP.log2 <-
  readr::read_csv(file = "data/Fd_PES_matSP.log2.csv")
## Rows: 7898 Columns: 6
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (1): GeneID
## dbl (5): Phylostratum, holdfast, reptip, stipe, vegtip
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
Fs_PES_M_matSP.log2 <-
  readr::read_csv(file = "data/Fs_PES_M_matSP.log2.csv")
## Rows: 8291 Columns: 6
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (1): GeneID
## dbl (5): Phylostratum, holdfast, reptip, stipe, vegtip
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
Fs_PES_F_matSP.log2 <-
  readr::read_csv(file = "data/Fs_PES_F_matSP.log2.csv")
## Rows: 8291 Columns: 6
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (1): GeneID
## dbl (5): Phylostratum, holdfast, reptip, stipe, vegtip
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
Fs_PES_matSP_holdfast.log2 <-
  Fs_PES_M_matSP.log2 %>% 
  dplyr::select(1:2 | dplyr::starts_with("holdfast")) %>%
  dplyr::rename_with(
    ~ paste0(.x, "_M"),
    dplyr::starts_with(c("holdfast")) &! dplyr::ends_with("_F"))
Fs_PES_matSP_holdfast.log2 <-
  Fs_PES_F_matSP.log2 %>% 
  dplyr::select(1:2 | dplyr::starts_with("holdfast")) %>%
  dplyr::rename_with(
    ~ paste0(.x, "_F"),
    dplyr::starts_with(c("holdfast")) &! dplyr::ends_with("_M")) %>%
  dplyr::left_join(Fs_PES_matSP_holdfast.log2)
## Joining with `by = join_by(Phylostratum, GeneID)`
Fs_PES_matSP_reptip.log2 <-
  Fs_PES_M_matSP.log2 %>% 
  dplyr::select(1:2 | dplyr::starts_with("reptip")) %>%
  dplyr::rename_with(
    ~ paste0(.x, "_M"),
    dplyr::starts_with(c("reptip")) &! dplyr::ends_with("_F"))
Fs_PES_matSP_reptip.log2 <-
  Fs_PES_F_matSP.log2 %>% 
  dplyr::select(1:2 | dplyr::starts_with("reptip")) %>%
  dplyr::rename_with(
    ~ paste0(.x, "_F"),
    dplyr::starts_with(c("reptip")) &! dplyr::ends_with("_M")) %>%
  dplyr::left_join(Fs_PES_matSP_reptip.log2)
## Joining with `by = join_by(Phylostratum, GeneID)`
Fs_PES_matSP_stipe.log2 <-
  Fs_PES_M_matSP.log2 %>% 
  dplyr::select(1:2 | dplyr::starts_with("stipe")) %>%
  dplyr::rename_with(
    ~ paste0(.x, "_M"),
    dplyr::starts_with(c("stipe")) &! dplyr::ends_with("_F"))
Fs_PES_matSP_stipe.log2 <-
  Fs_PES_F_matSP.log2 %>% 
  dplyr::select(1:2 | dplyr::starts_with("stipe")) %>%
  dplyr::rename_with(
    ~ paste0(.x, "_F"),
    dplyr::starts_with(c("stipe")) &! dplyr::ends_with("_M")) %>%
  dplyr::left_join(Fs_PES_matSP_stipe.log2)
## Joining with `by = join_by(Phylostratum, GeneID)`
Fs_PES_matSP_vegtip.log2 <-
  Fs_PES_M_matSP.log2 %>% 
  dplyr::select(1:2 | dplyr::starts_with("vegtip")) %>%
  dplyr::rename_with(
    ~ paste0(.x, "_M"),
    dplyr::starts_with(c("vegtip")) &! dplyr::ends_with("_F"))
Fs_PES_matSP_vegtip.log2 <-
  Fs_PES_F_matSP.log2 %>% 
  dplyr::select(1:2 | dplyr::starts_with("vegtip")) %>%
  dplyr::rename_with(
    ~ paste0(.x, "_F"),
    dplyr::starts_with(c("vegtip")) &! dplyr::ends_with("_M")) %>%
  dplyr::left_join(Fs_PES_matSP_vegtip.log2)
## Joining with `by = join_by(Phylostratum, GeneID)`

rank-tranformed

Fd_PES.rank <-
  readr::read_csv(file = "data/Fd_PES.rank.csv") %>%
  dplyr::select(!c("gamete","matSP"))
## Rows: 7898 Columns: 9
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (1): GeneID
## dbl (8): Phylostratum, gamete, E1, E2, E3, E4, E5, matSP
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
Fs_PES.rank <-
  readr::read_csv(file = "data/Fs_PES.rank.csv") %>%
  dplyr::select(!c("gamete","matSP"))
## Rows: 8291 Columns: 9
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (1): GeneID
## dbl (8): Phylostratum, gamete, 24H, 48H, 1w, 3w, 4w, matSP
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.

rlog-tranformed

Fd_PES.rlog <-
  readr::read_csv(file = "data/Fd_PES.rlog.csv") %>%
  dplyr::select(!c("gamete","matSP"))
## Rows: 7898 Columns: 9
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (1): GeneID
## dbl (8): Phylostratum, gamete, E1, E2, E3, E4, E5, matSP
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
Fs_PES.rlog <-
  readr::read_csv(file = "data/Fs_PES.rlog.csv") %>%
  dplyr::select(!c("gamete","matSP"))
## Rows: 8291 Columns: 9
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (1): GeneID
## dbl (8): Phylostratum, gamete, 24H, 48H, 1w, 3w, 4w, matSP
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.

PlotCategoryExpr()

Fucus distichus

# PlotCategoryExpr(
#   ExpressionSet = Fd_PES.log2,
#   legendName    = "PS",
#   test.stat     = TRUE,
#   type          = "category-centered",
#   distr.type    = "boxplot",
#   log.expr      = FALSE) +
#   ggplot2::labs(
#     title = "Fucus distichus",
#     subtitle = "log2(TPM+1)"
#   )

PlotCategoryExpr(
  ExpressionSet = Fd_PES.log2,
  legendName    = "PS",
  test.stat     = TRUE,
  type          = "stage-centered",
  distr.type    = "boxplot",
  log.expr      = FALSE) +
  ggplot2::labs(
    title = "Fucus distichus development",
    subtitle = "log2(TPM+1)"
  )
##                PS1   PS2 PS3    PS4    PS5    PS6    PS7   PS8  
## stage-centered "***" "*" "n.s." "n.s." "n.s." "n.s." "***" "***"

PlotCategoryExpr(
  ExpressionSet = Fd_PES_sex.log2,
  legendName    = "PS",
  test.stat     = TRUE,
  type          = "stage-centered",
  distr.type    = "boxplot",
  log.expr      = FALSE) +
  ggplot2::labs(
    title = "Fucus distichus gamete sexes",
    subtitle = "log2(TPM+1)"
  )
##                PS1   PS2   PS3    PS4    PS5    PS6   PS7   PS8  
## stage-centered "***" "***" "n.s." "n.s." "n.s." "***" "***" "***"

PlotCategoryExpr(
  ExpressionSet = Fd_PES_matSP.log2,
  legendName    = "PS",
  test.stat     = TRUE,
  type          = "stage-centered",
  distr.type    = "boxplot",
  log.expr      = FALSE) +
  ggplot2::labs(
    title = "Fucus distichus matSP tissues",
    subtitle = "log2(TPM+1)"
  )
##                PS1   PS2   PS3    PS4 PS5    PS6   PS7   PS8  
## stage-centered "***" "***" "n.s." "*" "n.s." "***" "***" "***"

Fucus serratus

# PlotCategoryExpr(
#   ExpressionSet = Fs_PES.log2,
#   legendName    = "PS",
#   test.stat     = TRUE,
#   type          = "category-centered",
#   distr.type    = "boxplot",
#   log.expr      = FALSE) +
#   ggplot2::labs(
#     title = "Fucus serratus",
#     subtitle = "log2(TPM+1)"
#   )

PlotCategoryExpr(
  ExpressionSet = Fs_PES.log2,
  legendName    = "PS",
  test.stat     = TRUE,
  type          = "stage-centered",
  distr.type    = "boxplot",
  log.expr      = FALSE) +
  ggplot2::labs(
    title = "Fucus serratus development",
    subtitle = "log2(TPM+1)"
  )
##                PS1   PS2 PS3    PS4    PS5    PS6    PS7 PS8  
## stage-centered "***" "*" "n.s." "n.s." "n.s." "n.s." "*" "***"

PlotCategoryExpr(
  ExpressionSet = Fs_PES_sex_gam.log2,
  legendName    = "PS",
  test.stat     = TRUE,
  type          = "stage-centered",
  distr.type    = "boxplot",
  log.expr      = FALSE) +
  ggplot2::labs(
    title = "Fucus serratus gamete sexes",
    subtitle = "log2(TPM+1)"
  )
##                PS1   PS2   PS3 PS4 PS5   PS6   PS7   PS8  
## stage-centered "***" "***" "*" "*" "***" "***" "***" "***"

PlotCategoryExpr(
  ExpressionSet = Fs_PES_sex_mat.log2,
  legendName    = "PS",
  test.stat     = TRUE,
  type          = "stage-centered",
  distr.type    = "boxplot",
  log.expr      = FALSE) +
  ggplot2::labs(
    title = "Fucus serratus matSP sexes",
    subtitle = "log2(TPM+1)"
  )
##                PS1    PS2    PS3    PS4    PS5    PS6    PS7    PS8  
## stage-centered "n.s." "n.s." "n.s." "n.s." "n.s." "n.s." "n.s." "***"

PlotCategoryExpr(
  ExpressionSet = Fs_PES_M_matSP.log2,
  legendName    = "PS",
  test.stat     = TRUE,
  type          = "stage-centered",
  distr.type    = "boxplot",
  log.expr      = FALSE) +
  ggplot2::labs(
    title = "Fucus serratus matSP (male) tissues",
    subtitle = "log2(TPM+1)"
  )
##                PS1   PS2   PS3  PS4   PS5  PS6   PS7   PS8  
## stage-centered "***" "***" "**" "***" "**" "***" "***" "***"

PlotCategoryExpr(
  ExpressionSet = Fs_PES_F_matSP.log2,
  legendName    = "PS",
  test.stat     = TRUE,
  type          = "stage-centered",
  distr.type    = "boxplot",
  log.expr      = FALSE) +
  ggplot2::labs(
    title = "Fucus serratus matSP (female) tissues",
    subtitle = "log2(TPM+1)"
  )
##                PS1   PS2   PS3    PS4    PS5    PS6 PS7   PS8  
## stage-centered "***" "***" "n.s." "n.s." "n.s." "*" "***" "***"

PlotCategoryExpr(
  ExpressionSet = Fs_PES_matSP_vegtip.log2,
  legendName    = "PS",
  test.stat     = TRUE,
  type          = "stage-centered",
  distr.type    = "boxplot",
  log.expr      = FALSE) +
  ggplot2::labs(
    title = "Fucus serratus matSP vegtip",
    subtitle = "log2(TPM+1)"
  )
##                PS1    PS2    PS3    PS4    PS5    PS6    PS7    PS8   
## stage-centered "n.s." "n.s." "n.s." "n.s." "n.s." "n.s." "n.s." "n.s."

PlotCategoryExpr(
  ExpressionSet = Fs_PES_matSP_reptip.log2,
  legendName    = "PS",
  test.stat     = TRUE,
  type          = "stage-centered",
  distr.type    = "boxplot",
  log.expr      = FALSE) +
  ggplot2::labs(
    title = "Fucus serratus matSP reptip",
    subtitle = "log2(TPM+1)"
  )
##                PS1   PS2   PS3    PS4  PS5    PS6  PS7   PS8  
## stage-centered "***" "***" "n.s." "**" "n.s." "**" "***" "***"

PlotCategoryExpr(
  ExpressionSet = Fs_PES_matSP_stipe.log2,
  legendName    = "PS",
  test.stat     = TRUE,
  type          = "stage-centered",
  distr.type    = "boxplot",
  log.expr      = FALSE) +
  ggplot2::labs(
    title = "Fucus serratus matSP stipe",
    subtitle = "log2(TPM+1)"
  )
##                PS1   PS2   PS3    PS4    PS5    PS6    PS7   PS8  
## stage-centered "***" "***" "n.s." "n.s." "n.s." "n.s." "***" "***"

PlotCategoryExpr(
  ExpressionSet = Fs_PES_matSP_holdfast.log2,
  legendName    = "PS",
  test.stat     = TRUE,
  type          = "stage-centered",
  distr.type    = "boxplot",
  log.expr      = FALSE) +
  ggplot2::labs(
    title = "Fucus serratus matSP holdfast",
    subtitle = "log2(TPM+1)"
  )
##                PS1    PS2    PS3    PS4    PS5    PS6    PS7    PS8  
## stage-centered "n.s." "n.s." "n.s." "n.s." "n.s." "n.s." "n.s." "***"

The results are a lot clearer with our RNA-seq data compared to the microarray data of PhyloExpressionSetExample.

Ectocarpus analysis

Here, I focus on the stages that generates the Fucus embryo, i.e. stages not gamates nor matSP.

Ec_PES_32m <-
  readr::read_csv(file = "data/Ec_PES_32m.csv")
## Rows: 11571 Columns: 11
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr  (1): GeneID
## dbl (10): Phylostratum, meiospore, immGA, matGA, oldGA, gamete, earlyPSP, im...
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
Ec_PES_25f <-
  readr::read_csv(file = "data/Ec_PES_25f.csv")
## Rows: 11571 Columns: 11
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr  (1): GeneID
## dbl (10): Phylostratum, meiospore, immGA, matGA, oldGA, gamete, earlyPSP, im...
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.

sqrt-tranformed

Ec_PES_32m.sqrt <-
  readr::read_csv(file = "data/Ec_PES_32m.sqrt.csv")
## Rows: 11571 Columns: 11
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr  (1): GeneID
## dbl (10): Phylostratum, meiospore, immGA, matGA, oldGA, gamete, earlyPSP, im...
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
Ec_PES_25f.sqrt <-
  readr::read_csv(file = "data/Ec_PES_25f.sqrt.csv")
## Rows: 11571 Columns: 11
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr  (1): GeneID
## dbl (10): Phylostratum, meiospore, immGA, matGA, oldGA, gamete, earlyPSP, im...
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.

log2-tranformed

Ec_PES_32m.log2 <-
  readr::read_csv(file = "data/Ec_PES_32m.log2.csv")
## Rows: 11571 Columns: 11
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr  (1): GeneID
## dbl (10): Phylostratum, meiospore, immGA, matGA, oldGA, gamete, earlyPSP, im...
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
Ec_PES_25f.log2 <-
  readr::read_csv(file = "data/Ec_PES_25f.log2.csv")
## Rows: 11571 Columns: 11
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr  (1): GeneID
## dbl (10): Phylostratum, meiospore, immGA, matGA, oldGA, gamete, earlyPSP, im...
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.

rank-tranformed

Ec_PES_32m.rank <-
  readr::read_csv(file = "data/Ec_PES_32m.rank.csv")
## Rows: 11571 Columns: 11
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr  (1): GeneID
## dbl (10): Phylostratum, meiospore, immGA, matGA, oldGA, gamete, earlyPSP, im...
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
Ec_PES_25f.rank <-
  readr::read_csv(file = "data/Ec_PES_25f.rank.csv")
## Rows: 11571 Columns: 11
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr  (1): GeneID
## dbl (10): Phylostratum, meiospore, immGA, matGA, oldGA, gamete, earlyPSP, im...
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.

rlog-tranformed

Ec_PES_32m.rlog <-
  readr::read_csv(file = "data/Ec_PES_32m.rlog.csv")
## Rows: 11571 Columns: 11
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr  (1): GeneID
## dbl (10): Phylostratum, meiospore, immGA, matGA, oldGA, gamete, earlyPSP, im...
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
Ec_PES_25f.rlog <-
  readr::read_csv(file = "data/Ec_PES_25f.rlog.csv")
## Rows: 11571 Columns: 11
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr  (1): GeneID
## dbl (10): Phylostratum, meiospore, immGA, matGA, oldGA, gamete, earlyPSP, im...
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.

PlotCategoryExpr()

Ectocaprus Male

PlotCategoryExpr(
  ExpressionSet = Ec_PES_32m.log2,
  legendName    = "PS",
  test.stat     = TRUE,
  type          = "stage-centered",
  distr.type    = "boxplot",
  log.expr      = FALSE) +
  ggplot2::labs(
    title = "Ectocarpus (male)",
    subtitle = "log2(TPM+1)"
  )
##                PS1   PS2   PS3   PS4   PS5   PS6   PS7   PS8   PS9   PS10 
## stage-centered "***" "***" "***" "***" "***" "***" "***" "***" "***" "***"
##                PS11 
## stage-centered "***"

PlotCategoryExpr(
  ExpressionSet = Ec_PES_25f.log2,
  legendName    = "PS",
  test.stat     = TRUE,
  type          = "stage-centered",
  distr.type    = "boxplot",
  log.expr      = FALSE) +
  ggplot2::labs(
    title = "Ectocarpus (female)",
    subtitle = "log2(TPM+1)"
  )
##                PS1   PS2   PS3   PS4   PS5   PS6   PS7   PS8   PS9   PS10 
## stage-centered "***" "***" "***" "***" "***" "***" "***" "***" "***" "***"
##                PS11 
## stage-centered "***"

PlotCategoryExpr(
  ExpressionSet = Ec_PES_32m.rlog,
  legendName    = "PS",
  test.stat     = TRUE,
  type          = "stage-centered",
  distr.type    = "boxplot",
  log.expr      = FALSE) +
  ggplot2::labs(
    title = "Ectocarpus (male)",
    subtitle = "rlog(TPM+1)"
  )
##                PS1   PS2   PS3   PS4   PS5   PS6   PS7   PS8   PS9   PS10 
## stage-centered "***" "***" "***" "***" "***" "***" "***" "***" "***" "***"
##                PS11 
## stage-centered "***"

PlotCategoryExpr(
  ExpressionSet = Ec_PES_25f.rlog,
  legendName    = "PS",
  test.stat     = TRUE,
  type          = "stage-centered",
  distr.type    = "boxplot",
  log.expr      = FALSE) +
  ggplot2::labs(
    title = "Ectocarpus (female)",
    subtitle = "rlog(TPM+1)"
  )
##                PS1   PS2   PS3   PS4   PS5   PS6   PS7   PS8   PS9   PS10 
## stage-centered "***" "***" "***" "***" "***" "***" "***" "***" "***" "***"
##                PS11 
## stage-centered "***"

PlotCategoryExpr(
  ExpressionSet = dplyr::select(Ec_PES_32m.log2, c(1,2) | dplyr::ends_with("PSP")),
  legendName    = "PS",
  test.stat     = TRUE,
  type          = "stage-centered",
  distr.type    = "boxplot",
  log.expr      = FALSE) +
  ggplot2::labs(
    title = "Ectocarpus (male) multicellular PSP",
    subtitle = "log2(TPM+1)"
  )
##                PS1   PS2   PS3  PS4   PS5    PS6   PS7   PS8   PS9   PS10 
## stage-centered "***" "***" "**" "***" "n.s." "***" "***" "***" "***" "***"
##                PS11 
## stage-centered "***"

PlotCategoryExpr(
  ExpressionSet = dplyr::select(Ec_PES_25f.log2, c(1,2) | dplyr::ends_with("PSP")),
  legendName    = "PS",
  test.stat     = TRUE,
  type          = "stage-centered",
  distr.type    = "boxplot",
  log.expr      = FALSE) +
  ggplot2::labs(
    title = "Ectocarpus (female) multicellular PSP",
    subtitle = "log2(TPM+1)"
  )
##                PS1   PS2   PS3 PS4   PS5  PS6   PS7   PS8   PS9   PS10 PS11
## stage-centered "***" "***" "*" "***" "**" "***" "***" "***" "***" "*"  "*"

PlotCategoryExpr(
  ExpressionSet = dplyr::select(Ec_PES_32m.log2, c(1,2) | dplyr::ends_with("GA")),
  legendName    = "PS",
  test.stat     = TRUE,
  type          = "stage-centered",
  distr.type    = "boxplot",
  log.expr      = FALSE) +
  ggplot2::labs(
    title = "Ectocarpus (male) multicellular GA",
    subtitle = "log2(TPM+1)"
  )
##                PS1   PS2   PS3    PS4   PS5    PS6 PS7   PS8   PS9  PS10 PS11 
## stage-centered "***" "***" "n.s." "***" "n.s." "*" "***" "***" "**" "**" "***"

PlotCategoryExpr(
  ExpressionSet = dplyr::select(Ec_PES_25f.log2, c(1,2) | dplyr::ends_with("GA")),
  legendName    = "PS",
  test.stat     = TRUE,
  type          = "stage-centered",
  distr.type    = "boxplot",
  log.expr      = FALSE) +
  ggplot2::labs(
    title = "Ectocarpus (female) multicellular GA",
    subtitle = "log2(TPM+1)"
  )
##                PS1   PS2   PS3    PS4   PS5 PS6   PS7   PS8   PS9 PS10 PS11  
## stage-centered "***" "***" "n.s." "***" "*" "***" "***" "***" "*" "**" "n.s."

Summary

In Fucus, PS1 and PS8 are clearly differentially expressed on average between developmental stages (as defined in myTAI’s PlotCategoryExpr()). PS2 and PS7 also give some traces of differential expression. In F. distichus gametes, males have a lower expression level across most PS’s (significant in PS1, PS2, PS6, PS7 and PS8). In F. serratus gametes, this is also the case but the differences are more pronounced (significant across all PS’s). F. serratus is dioecious and in the matSP, we find that only PS8 is significantly differentially regulated between sexes when averaging all constituent tissues together.

Between tissue types of matSP in both Fucus species, essentially all gene age categories are differentially expressed. Focusing on the differences between sexes of matSP tissue types in the dioecious F. serratus, we see no significant differences between sexes in the vegetative tip (vegtip). PS8 is differentially expressed in the holdfast. PS1, PS2, PS7 and PS8 are differentially expressed in the stipe. As we would suspect, the sex-differences are greatest in the reproductive tip (reptip).

Together, this indicates that PS1 and PS8 genes are recruited to play a large role in the development of Fucus. PS8 plays a role in adult sex differentiation in dioecious F. serratus. In both F. serratus and F. distichus, the gametes differentially expresses many PS’s. Furthermore, it is surprising that most PS’s are differentially expressed between tissues, while the number of differentially expressed PS’s is more restricted during development. It is also surprising that many PS are differentially expressed between sexes in the stipe in the dioecious F. serratus, compared to other non-reproductive tissues such as the holdfast and vegtip. As we expect, differential PS expression is greatest between sexes in the reptip, whose cell-type composition foretells the differences in the gamete.

Compared to the age profile in Fucus, in Ectocarpus all gene ages are differentially expressed between developmental stages, even when considering just the multicellular PSP or GA. This points to a more dynamic transcriptional landscape through development, which involves genes from all levels of sequence-space conservation. When including all stages together, we see that the unicellar stages have less expression across all PS, though this difference could be due to the lower RNA quality in meiospores and mitospores. Lastly, unlike Ectocarpus, in Fucus, we lack some PS’s and most genes belong to PS1 and PS8. Thus, the resolution for this analysis is less fine in Fucus.

Get session info.

devtools::session_info()
## ─ Session info ───────────────────────────────────────────────────────────────
##  setting  value
##  version  R version 4.2.2 (2022-10-31)
##  os       macOS Big Sur ... 10.16
##  system   x86_64, darwin17.0
##  ui       X11
##  language (EN)
##  collate  en_GB.UTF-8
##  ctype    en_GB.UTF-8
##  tz       Europe/Berlin
##  date     2023-08-16
##  pandoc   2.19.2 @ /Applications/RStudio.app/Contents/MacOS/quarto/bin/tools/ (via rmarkdown)
## 
## ─ Packages ───────────────────────────────────────────────────────────────────
##  package     * version    date (UTC) lib source
##  bit           4.0.5      2022-11-15 [1] CRAN (R 4.2.0)
##  bit64         4.0.5      2020-08-30 [1] CRAN (R 4.2.0)
##  bslib         0.5.0      2023-06-09 [1] CRAN (R 4.2.0)
##  cachem        1.0.8      2023-05-01 [1] CRAN (R 4.2.0)
##  callr         3.7.3      2022-11-02 [1] CRAN (R 4.2.0)
##  cli           3.6.1      2023-03-23 [1] CRAN (R 4.2.0)
##  codetools     0.2-19     2023-02-01 [1] CRAN (R 4.2.0)
##  colorspace    2.1-0      2023-01-23 [1] CRAN (R 4.2.0)
##  crayon        1.5.2      2022-09-29 [1] CRAN (R 4.2.0)
##  devtools      2.4.5      2022-10-11 [1] CRAN (R 4.2.0)
##  digest        0.6.33     2023-07-07 [1] CRAN (R 4.2.0)
##  dplyr       * 1.1.2      2023-04-20 [1] CRAN (R 4.2.0)
##  ellipsis      0.3.2      2021-04-29 [1] CRAN (R 4.2.0)
##  evaluate      0.21       2023-05-05 [1] CRAN (R 4.2.0)
##  fansi         1.0.4      2023-01-22 [1] CRAN (R 4.2.0)
##  farver        2.1.1      2022-07-06 [1] CRAN (R 4.2.0)
##  fastmap       1.1.1      2023-02-24 [1] CRAN (R 4.2.0)
##  forcats     * 1.0.0      2023-01-29 [1] CRAN (R 4.2.0)
##  foreach       1.5.2      2022-02-02 [1] CRAN (R 4.2.0)
##  fs            1.6.3      2023-07-20 [1] CRAN (R 4.2.0)
##  generics      0.1.3      2022-07-05 [1] CRAN (R 4.2.0)
##  ggplot2     * 3.4.2      2023-04-03 [1] CRAN (R 4.2.0)
##  glue          1.6.2      2022-02-24 [1] CRAN (R 4.2.0)
##  gtable        0.3.3      2023-03-21 [1] CRAN (R 4.2.0)
##  highr         0.10       2022-12-22 [1] CRAN (R 4.2.0)
##  hms           1.1.3      2023-03-21 [1] CRAN (R 4.2.0)
##  htmltools     0.5.5      2023-03-23 [1] CRAN (R 4.2.0)
##  htmlwidgets   1.6.2      2023-03-17 [1] CRAN (R 4.2.0)
##  httpuv        1.6.11     2023-05-11 [1] CRAN (R 4.2.2)
##  iterators     1.0.14     2022-02-05 [1] CRAN (R 4.2.0)
##  jquerylib     0.1.4      2021-04-26 [1] CRAN (R 4.2.0)
##  jsonlite      1.8.7      2023-06-29 [1] CRAN (R 4.2.0)
##  knitr         1.43       2023-05-25 [1] CRAN (R 4.2.2)
##  labeling      0.4.2      2020-10-20 [1] CRAN (R 4.2.0)
##  later         1.3.1      2023-05-02 [1] CRAN (R 4.2.2)
##  lattice       0.21-8     2023-04-05 [1] CRAN (R 4.2.0)
##  lifecycle     1.0.3      2022-10-07 [1] CRAN (R 4.2.0)
##  lubridate   * 1.9.2      2023-02-10 [1] CRAN (R 4.2.0)
##  magrittr      2.0.3      2022-03-30 [1] CRAN (R 4.2.0)
##  Matrix        1.5-4.1    2023-05-18 [1] CRAN (R 4.2.0)
##  memoise       2.0.1      2021-11-26 [1] CRAN (R 4.2.0)
##  mime          0.12       2021-09-28 [1] CRAN (R 4.2.0)
##  miniUI        0.1.1.1    2018-05-18 [1] CRAN (R 4.2.0)
##  munsell       0.5.0      2018-06-12 [1] CRAN (R 4.2.0)
##  myTAI       * 1.0.1.9000 2023-08-14 [1] Github (drostlab/myTAI@d31325e)
##  pillar        1.9.0      2023-03-22 [1] CRAN (R 4.2.0)
##  pkgbuild      1.4.2      2023-06-26 [1] CRAN (R 4.2.0)
##  pkgconfig     2.0.3      2019-09-22 [1] CRAN (R 4.2.0)
##  pkgload       1.3.2.1    2023-07-08 [1] CRAN (R 4.2.0)
##  plyr          1.8.8      2022-11-11 [1] CRAN (R 4.2.0)
##  prettyunits   1.1.1      2020-01-24 [1] CRAN (R 4.2.0)
##  processx      3.8.2      2023-06-30 [1] CRAN (R 4.2.0)
##  profvis       0.3.8      2023-05-02 [1] CRAN (R 4.2.0)
##  promises      1.2.1      2023-08-10 [1] CRAN (R 4.2.2)
##  ps            1.7.5      2023-04-18 [1] CRAN (R 4.2.0)
##  purrr       * 1.0.2      2023-08-10 [1] CRAN (R 4.2.2)
##  R6            2.5.1      2021-08-19 [1] CRAN (R 4.2.0)
##  Rcpp          1.0.11     2023-07-06 [1] CRAN (R 4.2.0)
##  readr       * 2.1.4      2023-02-10 [1] CRAN (R 4.2.0)
##  remotes       2.4.2.1    2023-07-18 [1] CRAN (R 4.2.2)
##  reshape2      1.4.4      2020-04-09 [1] CRAN (R 4.2.0)
##  rlang         1.1.1      2023-04-28 [1] CRAN (R 4.2.0)
##  rmarkdown     2.23       2023-07-01 [1] CRAN (R 4.2.0)
##  rstudioapi    0.15.0     2023-07-07 [1] CRAN (R 4.2.0)
##  sass          0.4.7      2023-07-15 [1] CRAN (R 4.2.0)
##  scales        1.2.1      2022-08-20 [1] CRAN (R 4.2.0)
##  sessioninfo   1.2.2      2021-12-06 [1] CRAN (R 4.2.0)
##  shiny         1.7.4.1    2023-07-06 [1] CRAN (R 4.2.0)
##  stringi       1.7.12     2023-01-11 [1] CRAN (R 4.2.0)
##  stringr     * 1.5.0      2022-12-02 [1] CRAN (R 4.2.0)
##  tibble      * 3.2.1      2023-03-20 [1] CRAN (R 4.2.0)
##  tidyr       * 1.3.0      2023-01-24 [1] CRAN (R 4.2.0)
##  tidyselect    1.2.0      2022-10-10 [1] CRAN (R 4.2.0)
##  tidyverse   * 2.0.0      2023-02-22 [1] CRAN (R 4.2.0)
##  timechange    0.2.0      2023-01-11 [1] CRAN (R 4.2.0)
##  tzdb          0.4.0      2023-05-12 [1] CRAN (R 4.2.2)
##  urlchecker    1.0.1      2021-11-30 [1] CRAN (R 4.2.0)
##  usethis       2.2.2      2023-07-06 [1] CRAN (R 4.2.0)
##  utf8          1.2.3      2023-01-31 [1] CRAN (R 4.2.0)
##  vctrs         0.6.3      2023-06-14 [1] CRAN (R 4.2.0)
##  viridisLite   0.4.2      2023-05-02 [1] CRAN (R 4.2.0)
##  vroom         1.6.3      2023-04-28 [1] CRAN (R 4.2.0)
##  withr         2.5.0      2022-03-03 [1] CRAN (R 4.2.0)
##  xfun          0.40       2023-08-09 [1] CRAN (R 4.2.2)
##  xtable        1.8-4      2019-04-21 [1] CRAN (R 4.2.0)
##  yaml          2.3.7      2023-01-23 [1] CRAN (R 4.2.0)
## 
##  [1] /Library/Frameworks/R.framework/Versions/4.2/Resources/library
## 
## ──────────────────────────────────────────────────────────────────────────────